<!DOCTYPE html>
<html>
<head>
<Title>TBA Activity Registration || Admin Page</Title>
	<!-- css3 formak, style-ok a designhoz, kinezethez-->
    <script src="libraries/jquery.min.js" ></script>
	<link href="Design.css" rel="stylesheet" type="text/css">
	<link rel="stylesheet" href="css/stat.css" type="text/css" media="screen" />
	<link href="style.css" rel="stylesheet" type="text/css">
	<script type="text/javascript">
		function errorfind(){<!--parameterbol kivesszuk az uzenet kodjat amihez kotodo uzenetet megjelenitunk-->
			var tmp = decodeURI(
				(RegExp("succes" + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
			);
			if (tmp == "true1")
				alert("Administrator right set succesfully!");
			if (tmp == "false1")
				alert("Administrator right set failed!");
			if (tmp == "true2")
				alert("Delete succesfully!");
			if (tmp == "false2")
				alert("Delete failed!");
		}<!--atvesszuk a valtozokba az adatbazisbol egyes listakat-->
		var fullname = [<?php include "classes.php"; $pclass = new users; $pclass->getuserlistdb($username,$fullname,$db,$t);echo "$fullname";?>];
		var username = [<?php echo "$username";?>];
		function populateList() {
			var listLen=fullname.length;
			for(var i=0; i<listLen; i++){<!--egy valasztasi listaba javascriptel feltoltjuk a lista elemeivel-->
				document.userform.username.options[i]=new Option(fullname[i], username[i]);
			}
			errorfind();
		}
		window.onload=populateList;
	</script>
</head>
<body style="background-color:#69F;">
	<br><div id="title" style="background-color:#69F;">Edit Users</div><br>
	<table id="manager">
		<td id="managerbuttons" style="vertical-align:text-top;">
		<!--az adminnak a funkcioihoz a gombok amelyek atiranyitjak az adott funciokhoz
			projekt statisztikak-->
			<a href="projects.php?pid=1"><button id="button" width="50">Projects</button></a><br>
			<!-- alkalmazottak statisztikaja-->
			<a href="people.php?aid=Alt.Attila5"><button id="button" width="50">Employments</button></a><br>
			<!-- activityk kezelese-->
			<a href="activityedit.php"><button id="button" width="50">Edit Activities</button></a><br>
			<!-- altalanos statisztika -->
			<a href="stat.php"><button id="button" style="width:50">Statistics</button></a><br>
			<!-- admin jog kiosztasa-->
			<a href="usersettings.php"><button id="button" style="width:50">Edit Users</button></a><br>
			<!-- admin feluletrol kijelentkezes-->
			<a href="BLL.php?logout="><button id="button" style="width:50">Logout</button></a><br>
		</td>
		<td id="managerinfo" style="background-color:#69F;">
						<br><div id="subtitle">Username:</div><br>
			<form name="userform" action="BLL.php"> 	
				<!--lista a felhasznalonevekkel, ertekeit a javascript populatelist fuggveny adja meg-->			
				<select name="username">
				</select><br>
				<!-- megerositesi gomb ha adminna akarjuk tenni-->
				<br><input id="button" name="adminset" type="submit" name="admin" value="Set administrator rights!">
				<!--megerosites gomb ha torolni akarjuk a kivalasztot felhasznalot-->
				<br><input id="button" type="submit" name="deleteuser" value="Delete user!">
			</form>
		</td>
	</table>
</body>
</html>